<?php

namespace app\home\controller;

use app\home\model\Examtype;

class  Examtypes extends Base
{
    public function index()
    {
      $res = Examtype::where("status=1")->order("sort","asc")->field("id,name")->select();
      $resArr = collection($res)->toArray();
      return json($resArr);
    }
    //查询第一个报考类型的名称
    public function first_name()
    {
      $res = Examtype::order("sort","asc")->find();
      echo  $res['name'];
    }
    //查询第一个报考类型的id
    public function first_id()
    {
        $res = Examtype::order("sort","asc")->find();
        echo  $res['id'];
    }


}
